package com.kili.file.config.factory;

import com.kili.file.config.factory.subabstract.AbstractLocalFactoryBean;
import com.kili.file.config.systemparam.FileUploadLocalParamConfig;
import com.kili.file.service.FileUploadService;
import com.kili.file.service.impl.FileUploadWithLocalStorage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * LocalFileUploadFactoryBean
 *
 * @author jackliang
 * @date 19-4-2
 * @description
 */
@Slf4j
public class LocalFileUploadFactoryBean extends AbstractLocalFactoryBean implements FactoryBean<FileUploadService> {

    @Autowired
    private FileUploadLocalParamConfig fileUploadLocalParamConfig;

    @Override
    public FileUploadService getObject() {
        log.trace("Initialized class [" + FileUploadWithLocalStorage.class.getName() + "] for local file upload logically");
        fileUploadWithLocalStorage.setParamConfig(fileUploadLocalParamConfig);
        return fileUploadWithLocalStorage;
    }

    @Override
    public Class<?> getObjectType() {
        return FileUploadWithLocalStorage.class;
    }

    @Override
    public boolean isSingleton() {
        return IS_SINGLETON;
    }

    @Override
    public Object coreWithHandler(Object o) {
        return null;
    }

}
